cmake_minimum_required(VERSION 2.6.4)
project(crude) 

if (POLICY CMP0048)
  cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048) 

#Traversal Files
set(BASE_PATH ".")
file(GLOB_RECURSE SRC_CORE "${BASE_PATH}/src/*.*")
file(GLOB_RECURSE SRC_TEST "${BASE_PATH}/test/*.cpp")
file(GLOB_RECURSE HEADERS "${BASE_PATH}/include/*.h")
file(GLOB_RECURSE SRC_GTEST "${BASE_PATH}/test/gtest/src/gtest-all.cc")

set(ALL_LIST  ${HEADERS} ${SRC_CORE} ${SRC_TEST} ${SRC_GTEST})

# Base compile define.	

if (CMAKE_SYSTEM_NAME MATCHES "Windows")  
	add_definitions("/EHsc")
else()
	add_definitions("$ENV{CXXFLAGS} -lstdc++ -pthread -lm")
endif()



# Binary output path and binary name.
set(EXECUTABLE_OUTPUT_PATH "${BASE_PATH}/build/")

set(BINARY_NAME "crude_test")
message(${BINARY_NAME})

# Include path and link path.
include_directories(${BASE_PATH}/include ${BASE_PATH}/test/gtest/include ${BASE_PATH}/test/gtest })

add_executable(crude ${ALL_LIST})